<html>
    <head></head>
    <body>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    接收者<input type="text" id="fid">
    发送内容<input type="text" id="content">
    <button onclick="aaa()">发送</button>
    <script>
        var ws = new WebSocket("ws://192.168.33.10:9502");
        ws.onopen = function () {
                console.log('lianjiezhong')
        };
        ws.onclose = function () {
                console.log("lianjieguanbi")
        };
        ws.onmessage = function (evt) {
            console.log(evt)
        };
        function aaa(){
            console.log('发送');
            ws.send(JSON.stringify(['swoole',{
                name:11
            }]));
        }

    </script>
    </body>
</html>